Optimal. Leaf size=351 \[ \frac {a (A b-a B) \tan ^3(c+d x)}{3 b d \left (a^2+b^2\right ) (a+b \tan (c+d x))^3}+\frac {a \left (2 A b^3-a B \left (a^2+3 b^2\right )\right ) \tan ^2(c+d x)}{2 b^2 d \left (a^2+b^2\right )^2 (a+b \tan (c+d x))^2}+\frac {a^2 \left (a^5 B+3 a^3 b^2 B+a^2 A b^3+6 a b^4 B-3 A b^5\right )}{b^4 d \left (a^2+b^2\right )^3 (a+b \tan (c+d x))}+\frac {\left (a^4 (-B)+4 a^3 A b+6 a^2 b^2 B-4 a A b^3-b^4 B\right ) \log (\cos (c+d x))}{d \left (a^2+b^2\right )^4}+\frac {x \left (a^4 A+4 a^3 b B-6 a^2 A b^2-4 a b^3 B+A b^4\right )}{\left (a^2+b^2\right )^4}+\frac {a \left (a^7 B+4 a^5 b^2 B+5 a^3 b^4 B+4 a^2 A b^5+10 a b^6 B-4 A b^7\right ) \log (a+b \tan (c+d x))}{b^4 d \left (a^2+b^2\right )^4} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.82, antiderivative size = 351, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {3605, 3645, 3635, 3626, 3617, 31, 3475} \[ \frac {a (A b-a B) \tan ^3(c+d x)}{3 b d \left (a^2+b^2\right ) (a+b \tan (c+d x))^3}+\frac {a \left (2 A b^3-a B \left (a^2+3 b^2\right )\right ) \tan ^2(c+d x)}{2 b^2 d \left (a^2+b^2\right )^2 (a+b \tan (c+d x))^2}+\frac {a^2 \left (a^2 A b^3+3 a^3 b^2 B+a^5 B+6 a b^4 B-3 A b^5\right )}{b^4 d \left (a^2+b^2\right )^3 (a+b \tan (c+d x))}+\frac {a \left (4 a^2 A b^5+4 a^5 b^2 B+5 a^3 b^4 B+a^7 B+10 a b^6 B-4 A b^7\right ) \log (a+b \tan (c+d x))}{b^4 d \left (a^2+b^2\right )^4}+\frac {\left (4 a^3 A b+6 a^2 b^2 B+a^4 (-B)-4 a A b^3-b^4 B\right ) \log (\cos (c+d x))}{d \left (a^2+b^2\right )^4}+\frac {x \left (-6 a^2 A b^2+a^4 A+4 a^3 b B-4 a b^3 B+A b^4\right )}{\left (a^2+b^2\right )^4} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 3475
Rule 3605
Rule 3617
Rule 3626
Rule 3635
Rule 3645
Rubi steps
\begin {align*} \int \frac {\tan ^4(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^4} \, dx &=\frac {a (A b-a B) \tan ^3(c+d x)}{3 b \left (a^2+b^2\right ) d (a+b \tan (c+d x))^3}+\frac {\int \frac {\tan ^2(c+d x) \left (-3 a (A b-a B)+3 b (A b-a B) \tan (c+d x)+3 \left (a^2+b^2\right ) B \tan ^2(c+d x)\right )}{(a+b \tan (c+d x))^3} \, dx}{3 b \left (a^2+b^2\right )}\\ &=\frac {a (A b-a B) \tan ^3(c+d x)}{3 b \left (a^2+b^2\right ) d (a+b \tan (c+d x))^3}+\frac {a \left (2 A b^3-a \left (a^2+3 b^2\right ) B\right ) \tan ^2(c+d x)}{2 b^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))^2}+\frac {\int \frac {\tan (c+d x) \left (-6 a \left (2 A b^3-a \left (a^2+3 b^2\right ) B\right )-6 b^2 \left (a^2 A-A b^2+2 a b B\right ) \tan (c+d x)+6 \left (a^2+b^2\right )^2 B \tan ^2(c+d x)\right )}{(a+b \tan (c+d x))^2} \, dx}{6 b^2 \left (a^2+b^2\right )^2}\\ &=\frac {a (A b-a B) \tan ^3(c+d x)}{3 b \left (a^2+b^2\right ) d (a+b \tan (c+d x))^3}+\frac {a \left (2 A b^3-a \left (a^2+3 b^2\right ) B\right ) \tan ^2(c+d x)}{2 b^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))^2}+\frac {a^2 \left (a^2 A b^3-3 A b^5+a^5 B+3 a^3 b^2 B+6 a b^4 B\right )}{b^4 \left (a^2+b^2\right )^3 d (a+b \tan (c+d x))}+\frac {\int \frac {6 a \left (a^2 A b^3-3 A b^5+a^5 B+3 a^3 b^2 B+6 a b^4 B\right )-6 b^3 \left (3 a^2 A b-A b^3-a^3 B+3 a b^2 B\right ) \tan (c+d x)+6 \left (a^2+b^2\right )^3 B \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{6 b^3 \left (a^2+b^2\right )^3}\\ &=\frac {\left (a^4 A-6 a^2 A b^2+A b^4+4 a^3 b B-4 a b^3 B\right ) x}{\left (a^2+b^2\right )^4}+\frac {a (A b-a B) \tan ^3(c+d x)}{3 b \left (a^2+b^2\right ) d (a+b \tan (c+d x))^3}+\frac {a \left (2 A b^3-a \left (a^2+3 b^2\right ) B\right ) \tan ^2(c+d x)}{2 b^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))^2}+\frac {a^2 \left (a^2 A b^3-3 A b^5+a^5 B+3 a^3 b^2 B+6 a b^4 B\right )}{b^4 \left (a^2+b^2\right )^3 d (a+b \tan (c+d x))}-\frac {\left (4 a^3 A b-4 a A b^3-a^4 B+6 a^2 b^2 B-b^4 B\right ) \int \tan (c+d x) \, dx}{\left (a^2+b^2\right )^4}+\frac {\left (a \left (4 a^2 A b^5-4 A b^7+a^7 B+4 a^5 b^2 B+5 a^3 b^4 B+10 a b^6 B\right )\right ) \int \frac {1+\tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b^3 \left (a^2+b^2\right )^4}\\ &=\frac {\left (a^4 A-6 a^2 A b^2+A b^4+4 a^3 b B-4 a b^3 B\right ) x}{\left (a^2+b^2\right )^4}+\frac {\left (4 a^3 A b-4 a A b^3-a^4 B+6 a^2 b^2 B-b^4 B\right ) \log (\cos (c+d x))}{\left (a^2+b^2\right )^4 d}+\frac {a (A b-a B) \tan ^3(c+d x)}{3 b \left (a^2+b^2\right ) d (a+b \tan (c+d x))^3}+\frac {a \left (2 A b^3-a \left (a^2+3 b^2\right ) B\right ) \tan ^2(c+d x)}{2 b^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))^2}+\frac {a^2 \left (a^2 A b^3-3 A b^5+a^5 B+3 a^3 b^2 B+6 a b^4 B\right )}{b^4 \left (a^2+b^2\right )^3 d (a+b \tan (c+d x))}+\frac {\left (a \left (4 a^2 A b^5-4 A b^7+a^7 B+4 a^5 b^2 B+5 a^3 b^4 B+10 a b^6 B\right )\right ) \operatorname {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (c+d x)\right )}{b^4 \left (a^2+b^2\right )^4 d}\\ &=\frac {\left (a^4 A-6 a^2 A b^2+A b^4+4 a^3 b B-4 a b^3 B\right ) x}{\left (a^2+b^2\right )^4}+\frac {\left (4 a^3 A b-4 a A b^3-a^4 B+6 a^2 b^2 B-b^4 B\right ) \log (\cos (c+d x))}{\left (a^2+b^2\right )^4 d}+\frac {a \left (4 a^2 A b^5-4 A b^7+a^7 B+4 a^5 b^2 B+5 a^3 b^4 B+10 a b^6 B\right ) \log (a+b \tan (c+d x))}{b^4 \left (a^2+b^2\right )^4 d}+\frac {a (A b-a B) \tan ^3(c+d x)}{3 b \left (a^2+b^2\right ) d (a+b \tan (c+d x))^3}+\frac {a \left (2 A b^3-a \left (a^2+3 b^2\right ) B\right ) \tan ^2(c+d x)}{2 b^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))^2}+\frac {a^2 \left (a^2 A b^3-3 A b^5+a^5 B+3 a^3 b^2 B+6 a b^4 B\right )}{b^4 \left (a^2+b^2\right )^3 d (a+b \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 6.91, size = 1812, normalized size = 5.16 \[ \text {result too large to display} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.86, size = 1113, normalized size = 3.17 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 2.22, size = 719, normalized size = 2.05 \[ \frac {\frac {6 \, {\left (A a^{4} + 4 \, B a^{3} b - 6 \, A a^{2} b^{2} - 4 \, B a b^{3} + A b^{4}\right )} {\left (d x + c\right )}}{a^{8} + 4 \, a^{6} b^{2} + 6 \, a^{4} b^{4} + 4 \, a^{2} b^{6} + b^{8}} + \frac {3 \, {\left (B a^{4} - 4 \, A a^{3} b - 6 \, B a^{2} b^{2} + 4 \, A a b^{3} + B b^{4}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{8} + 4 \, a^{6} b^{2} + 6 \, a^{4} b^{4} + 4 \, a^{2} b^{6} + b^{8}} + \frac {6 \, {\left (B a^{8} + 4 \, B a^{6} b^{2} + 5 \, B a^{4} b^{4} + 4 \, A a^{3} b^{5} + 10 \, B a^{2} b^{6} - 4 \, A a b^{7}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{8} b^{4} + 4 \, a^{6} b^{6} + 6 \, a^{4} b^{8} + 4 \, a^{2} b^{10} + b^{12}} - \frac {11 \, B a^{8} b^{2} \tan \left (d x + c\right )^{3} + 44 \, B a^{6} b^{4} \tan \left (d x + c\right )^{3} + 55 \, B a^{4} b^{6} \tan \left (d x + c\right )^{3} + 44 \, A a^{3} b^{7} \tan \left (d x + c\right )^{3} + 110 \, B a^{2} b^{8} \tan \left (d x + c\right )^{3} - 44 \, A a b^{9} \tan \left (d x + c\right )^{3} + 15 \, B a^{9} b \tan \left (d x + c\right )^{2} + 6 \, A a^{8} b^{2} \tan \left (d x + c\right )^{2} + 60 \, B a^{7} b^{3} \tan \left (d x + c\right )^{2} + 24 \, A a^{6} b^{4} \tan \left (d x + c\right )^{2} + 51 \, B a^{5} b^{5} \tan \left (d x + c\right )^{2} + 186 \, A a^{4} b^{6} \tan \left (d x + c\right )^{2} + 270 \, B a^{3} b^{7} \tan \left (d x + c\right )^{2} - 96 \, A a^{2} b^{8} \tan \left (d x + c\right )^{2} + 6 \, B a^{10} \tan \left (d x + c\right ) + 6 \, A a^{9} b \tan \left (d x + c\right ) + 21 \, B a^{8} b^{2} \tan \left (d x + c\right ) + 24 \, A a^{7} b^{3} \tan \left (d x + c\right ) - 24 \, B a^{6} b^{4} \tan \left (d x + c\right ) + 210 \, A a^{5} b^{5} \tan \left (d x + c\right ) + 225 \, B a^{4} b^{6} \tan \left (d x + c\right ) - 72 \, A a^{3} b^{7} \tan \left (d x + c\right ) + 2 \, A a^{10} - B a^{9} b + 6 \, A a^{8} b^{2} - 26 \, B a^{7} b^{3} + 74 \, A a^{6} b^{4} + 63 \, B a^{5} b^{5} - 18 \, A a^{4} b^{6}}{{\left (a^{8} b^{3} + 4 \, a^{6} b^{5} + 6 \, a^{4} b^{7} + 4 \, a^{2} b^{9} + b^{11}\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.28, size = 854, normalized size = 2.43 \[ \frac {10 a^{3} B}{d \left (a^{2}+b^{2}\right )^{3} \left (a +b \tan \left (d x +c \right )\right )}+\frac {5 a^{4} \ln \left (a +b \tan \left (d x +c \right )\right ) B}{d \left (a^{2}+b^{2}\right )^{4}}+\frac {A \arctan \left (\tan \left (d x +c \right )\right ) a^{4}}{d \left (a^{2}+b^{2}\right )^{4}}+\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a^{4} B}{2 d \left (a^{2}+b^{2}\right )^{4}}+\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) B \,b^{4}}{2 d \left (a^{2}+b^{2}\right )^{4}}+\frac {A \arctan \left (\tan \left (d x +c \right )\right ) b^{4}}{d \left (a^{2}+b^{2}\right )^{4}}-\frac {4 a \,b^{3} \ln \left (a +b \tan \left (d x +c \right )\right ) A}{d \left (a^{2}+b^{2}\right )^{4}}-\frac {6 A \arctan \left (\tan \left (d x +c \right )\right ) a^{2} b^{2}}{d \left (a^{2}+b^{2}\right )^{4}}+\frac {4 B \arctan \left (\tan \left (d x +c \right )\right ) a^{3} b}{d \left (a^{2}+b^{2}\right )^{4}}-\frac {4 B \arctan \left (\tan \left (d x +c \right )\right ) a \,b^{3}}{d \left (a^{2}+b^{2}\right )^{4}}+\frac {a^{8} \ln \left (a +b \tan \left (d x +c \right )\right ) B}{d \left (a^{2}+b^{2}\right )^{4} b^{4}}+\frac {4 a^{6} \ln \left (a +b \tan \left (d x +c \right )\right ) B}{d \left (a^{2}+b^{2}\right )^{4} b^{2}}-\frac {a^{6} A}{d \,b^{3} \left (a^{2}+b^{2}\right )^{3} \left (a +b \tan \left (d x +c \right )\right )}-\frac {3 a^{4} A}{d b \left (a^{2}+b^{2}\right )^{3} \left (a +b \tan \left (d x +c \right )\right )}+\frac {4 a^{3} b \ln \left (a +b \tan \left (d x +c \right )\right ) A}{d \left (a^{2}+b^{2}\right )^{4}}+\frac {a^{5} A}{d \,b^{3} \left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (d x +c \right )\right )^{2}}+\frac {2 a^{3} A}{d b \left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (d x +c \right )\right )^{2}}-\frac {3 a^{6} B}{2 d \,b^{4} \left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (d x +c \right )\right )^{2}}+\frac {a^{5} B}{3 d \,b^{4} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (d x +c \right )\right )^{3}}-\frac {5 a^{4} B}{2 d \,b^{2} \left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (d x +c \right )\right )^{2}}+\frac {2 \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a A \,b^{3}}{d \left (a^{2}+b^{2}\right )^{4}}-\frac {3 \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a^{2} b^{2} B}{d \left (a^{2}+b^{2}\right )^{4}}-\frac {2 \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) A \,a^{3} b}{d \left (a^{2}+b^{2}\right )^{4}}+\frac {9 a^{5} B}{d \,b^{2} \left (a^{2}+b^{2}\right )^{3} \left (a +b \tan \left (d x +c \right )\right )}-\frac {6 a^{2} b A}{d \left (a^{2}+b^{2}\right )^{3} \left (a +b \tan \left (d x +c \right )\right )}+\frac {3 a^{7} B}{d \,b^{4} \left (a^{2}+b^{2}\right )^{3} \left (a +b \tan \left (d x +c \right )\right )}-\frac {a^{4} A}{3 d \,b^{3} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (d x +c \right )\right )^{3}}+\frac {10 a^{2} b^{2} \ln \left (a +b \tan \left (d x +c \right )\right ) B}{d \left (a^{2}+b^{2}\right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.19, size = 583, normalized size = 1.66 \[ \frac {\frac {6 \, {\left (A a^{4} + 4 \, B a^{3} b - 6 \, A a^{2} b^{2} - 4 \, B a b^{3} + A b^{4}\right )} {\left (d x + c\right )}}{a^{8} + 4 \, a^{6} b^{2} + 6 \, a^{4} b^{4} + 4 \, a^{2} b^{6} + b^{8}} + \frac {6 \, {\left (B a^{8} + 4 \, B a^{6} b^{2} + 5 \, B a^{4} b^{4} + 4 \, A a^{3} b^{5} + 10 \, B a^{2} b^{6} - 4 \, A a b^{7}\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{8} b^{4} + 4 \, a^{6} b^{6} + 6 \, a^{4} b^{8} + 4 \, a^{2} b^{10} + b^{12}} + \frac {3 \, {\left (B a^{4} - 4 \, A a^{3} b - 6 \, B a^{2} b^{2} + 4 \, A a b^{3} + B b^{4}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{8} + 4 \, a^{6} b^{2} + 6 \, a^{4} b^{4} + 4 \, a^{2} b^{6} + b^{8}} + \frac {11 \, B a^{9} - 2 \, A a^{8} b + 34 \, B a^{7} b^{2} - 4 \, A a^{6} b^{3} + 47 \, B a^{5} b^{4} - 26 \, A a^{4} b^{5} + 6 \, {\left (3 \, B a^{7} b^{2} - A a^{6} b^{3} + 9 \, B a^{5} b^{4} - 3 \, A a^{4} b^{5} + 10 \, B a^{3} b^{6} - 6 \, A a^{2} b^{7}\right )} \tan \left (d x + c\right )^{2} + 3 \, {\left (9 \, B a^{8} b - 2 \, A a^{7} b^{2} + 28 \, B a^{6} b^{3} - 6 \, A a^{5} b^{4} + 35 \, B a^{4} b^{5} - 20 \, A a^{3} b^{6}\right )} \tan \left (d x + c\right )}{a^{9} b^{4} + 3 \, a^{7} b^{6} + 3 \, a^{5} b^{8} + a^{3} b^{10} + {\left (a^{6} b^{7} + 3 \, a^{4} b^{9} + 3 \, a^{2} b^{11} + b^{13}\right )} \tan \left (d x + c\right )^{3} + 3 \, {\left (a^{7} b^{6} + 3 \, a^{5} b^{8} + 3 \, a^{3} b^{10} + a b^{12}\right )} \tan \left (d x + c\right )^{2} + 3 \, {\left (a^{8} b^{5} + 3 \, a^{6} b^{7} + 3 \, a^{4} b^{9} + a^{2} b^{11}\right )} \tan \left (d x + c\right )}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.35, size = 486, normalized size = 1.38 \[ \frac {\frac {11\,B\,a^9-2\,A\,a^8\,b+34\,B\,a^7\,b^2-4\,A\,a^6\,b^3+47\,B\,a^5\,b^4-26\,A\,a^4\,b^5}{6\,b^4\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (3\,B\,a^7-A\,a^6\,b+9\,B\,a^5\,b^2-3\,A\,a^4\,b^3+10\,B\,a^3\,b^4-6\,A\,a^2\,b^5\right )}{b^2\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (9\,B\,a^8-2\,A\,a^7\,b+28\,B\,a^6\,b^2-6\,A\,a^5\,b^3+35\,B\,a^4\,b^4-20\,A\,a^3\,b^5\right )}{2\,b^3\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}}{d\,\left (a^3+3\,a^2\,b\,\mathrm {tan}\left (c+d\,x\right )+3\,a\,b^2\,{\mathrm {tan}\left (c+d\,x\right )}^2+b^3\,{\mathrm {tan}\left (c+d\,x\right )}^3\right )}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (A+B\,1{}\mathrm {i}\right )}{2\,d\,\left (a^4\,1{}\mathrm {i}-4\,a^3\,b-a^2\,b^2\,6{}\mathrm {i}+4\,a\,b^3+b^4\,1{}\mathrm {i}\right )}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B+A\,1{}\mathrm {i}\right )}{2\,d\,\left (a^4-a^3\,b\,4{}\mathrm {i}-6\,a^2\,b^2+a\,b^3\,4{}\mathrm {i}+b^4\right )}+\frac {a\,\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (B\,a^7+4\,B\,a^5\,b^2+5\,B\,a^3\,b^4+4\,A\,a^2\,b^5+10\,B\,a\,b^6-4\,A\,b^7\right )}{b^4\,d\,{\left (a^2+b^2\right )}^4} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: AttributeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________